//
//  Programme_DetailTableViewCell.m
//  fxxiaoke
//
//  Created by 鞠超 on 2016/11/2.
//  Copyright © 2016年 jc. All rights reserved.
//

#import "Programme_DetailTableViewCell.h"

@implementation Programme_DetailTableViewCell

- (instancetype )initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self)
    {
        [self p_setupView];
    }
    
    return self;
}

- (void )p_setupView
{
    self.image_Head = [[UIImageView alloc] init];
    self.image_Head.layer.cornerRadius = 20;
    self.image_Head.layer.masksToBounds = YES;
    self.image_Head.image = [UIImage imageNamed:@"heads.jpg"];
    [self.contentView addSubview:self.image_Head];
    
    //
    self.name = [[UILabel alloc] init];
    self.name.text = @"员工名称";
    self.name.font = [UIFont systemFontOfSize:15.0f];
    self.name.textAlignment = NSTextAlignmentLeft;
    self.name.textColor = [UIColor grayColor];
    [self.contentView addSubview:self.name];
    
    //
    self.image_support = [[UIImageView alloc] init];
    self.image_support.layer.masksToBounds = YES;
    self.image_support.image = [UIImage imageNamed:@"assist_gray.png"];
    [self.contentView addSubview:self.image_support];

    self.btn_support = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.contentView addSubview:self.btn_support];
    
    //
    self.image_reply = [[UIImageView alloc] init];
    self.image_reply.layer.masksToBounds = YES;
    self.image_reply.image = [UIImage imageNamed:@"reply_gray.png"];
    [self.contentView addSubview:self.image_reply];

    self.btn_reply = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.contentView addSubview:self.btn_reply];
    
    //
    self.time_detail = [[UILabel alloc] init];
    self.time_detail.text = @"今天 10:06 来自iPhone";
    self.time_detail.textColor = [UIColor grayColor];
    self.time_detail.textAlignment = NSTextAlignmentLeft;
    self.time_detail.font = [UIFont systemFontOfSize:15.0f];
    [self.contentView addSubview:self.time_detail];
    
    self.text_detail = [[UILabel alloc] init];
    self.text_detail.text = @"数据库及的会计师会计会计师的快速健康的监控及深刻的健康时数据库及的会计师会计会计师的快速健康的监控及深刻的健康时数据库及的会计师会计会计师的快速健康的监控及深刻的健康时数据库及的会计师会计会计师的快速健康的监控及深刻的健康时间段看";
    self.text_detail.textColor = [UIColor blackColor];
    self.text_detail.numberOfLines = 0;
    self.text_detail.font = [UIFont systemFontOfSize:17.0f];
    [self.contentView addSubview:self.text_detail];
}

- (void )layoutSubviews
{
    [super layoutSubviews];
    
    self.image_Head.frame = CGRectMake(10, 10, 40, 40);
    
    self.name.frame = CGRectMake(CGRectGetMaxX(self.image_Head.frame) + 12, 18, SCREEN_WIDTH / 2, 20);
    
    self.image_support.frame = CGRectMake(SCREEN_WIDTH - 50 - 40, 18, 20, 20);
    
    self.btn_support.frame = CGRectMake(SCREEN_WIDTH - 50 - 50, 5, 40, 40);
    
    self.image_reply.frame = CGRectMake(SCREEN_WIDTH - 40, 18, 20, 20);
    
    self.btn_reply.frame = CGRectMake(SCREEN_WIDTH - 50, 5, 40, 40);
    
    self.time_detail.frame = CGRectMake(CGRectGetMinX(self.name.frame), self.contentView.frame.size.height - 10 - 15, SCREEN_WIDTH - CGRectGetMinX(self.name.frame) - 10, 15);
        
    self.text_detail.frame = CGRectMake(CGRectGetMinX(self.name.frame), CGRectGetMaxY(self.image_Head.frame) + 5, SCREEN_WIDTH - CGRectGetMinX(self.name.frame) - 20, self.contentView.frame.size.height - 25 - CGRectGetMaxY(self.image_Head.frame) - 5 - 20);
}



@end
